﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ExSystem.ExWeb
{
    public class ExWebPage
    {
        public static string create_html_table_td(string tdContent, int rowspan, int colspan)
        {
           string rowspanStr="",colspanStr="";
           if (rowspan>0)rowspanStr=create_html_property("rowspan",rowspan.ToString());
           if (colspan>0)colspanStr=create_html_property("colspan",colspan.ToString());
           return string.Format("<td {1}{2}>{0}</td>", tdContent, rowspanStr, colspanStr);
        }
        public static string create_html_property(string propertyName,string propertyValue)
        {
            return string.Format("{0}=\"{1}\"", propertyName, propertyValue);
        }
        public static string create_html_table_thead(params string[] html_trs)
        {
            StringBuilder ss=new StringBuilder();
            foreach (string s in html_trs)
            {
                ss.AppendLine(s);
            }
            return string.Format("<thead>{0}</thead>", ss.ToString());
        }
    }
  
}
